package com.zerui.manager.devicegroup.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
import java.util.Set;

/**
 * @Author wh
 * @create_time 2023-08-23 15:28
 */
@ApiModel("设备分组")
@Data
@ToString
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "tb_device_group",autoResultMap = true)
public class DeviceGroupDo {

	@ApiModelProperty("主键，无业务含义")
	@TableId(value="id",type= IdType.ASSIGN_ID)
	@JsonFormat(shape = JsonFormat.Shape.STRING)
	private Long id;

	@ApiModelProperty("分组名称")
	private String orgName;

	@ApiModelProperty("上级id")
	private Long supId;

	@ApiModelProperty("绑定设备")
	@TableField(value = "device_ids",typeHandler = JacksonTypeHandler.class)
	private Set<String> deviceIds;

	@ApiModelProperty("创建时间")
	@JsonFormat(shape = JsonFormat.Shape.STRING,pattern ="yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
	private LocalDateTime createTime;

	@ApiModelProperty("更新时间")
	@JsonFormat(shape = JsonFormat.Shape.STRING,pattern ="yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
	private LocalDateTime updateTime;

}
